<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <input type="hidden" name="dateNow" id="dateNow"
                   th:value="${#dates.format(new java.util.Date().getTime(),'yyyy-MM-dd HH:mm:ss')}"/>

            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li class="select-time">
                            <label>对账时间： </label>
                            <input type="text" class="time-input" id="insertTime" placeholder="对账时间"
                                   name="insertTime"/>
                        </li>

                        <li>
                            上游用户id：<input type="text" name="acqUserId"/>
                        </li>

                        <li>
                            商户名称：<input type="text" name="userName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:orderGg:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()"
               shiro:hasPermission="system:orderGg:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "system/orderGg";
    $(function () {
        $("#insertTime").val($("#dateNow").val())
    })

    function queryParams(params) {
        return {
            "insertTime": $("#insertTime").val(),
            pageSize: params.limit,
            pageNum: params.offset / params.limit + 1,
            searchValue: params.search,
            orderByColumn: params.sort,
            isAsc: params.order
        };
    }

    $(function () {
        var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                exportUrl: prefix + "/export",
                modalName: "光谷订单对账",
                queryParams: queryParams,
                search: false,
                showExport: true,
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'id',
                        title: '主键id',
                        visible: false
                    },
                    {
                        field: 'insertTime',
                        title: '订单创建时间',
                        align: 'center',
                    },
                    {
                        field: 'userName',
                        title: '商户名称',
                        align: 'center',
                    },
                    {
                        field: 'idCard',
                        title: '身份证号',
                        align: 'center',
                    },
                    {
                        field: 'bankNumber',
                        title: '银行卡号',
                        formatter: function (value, row, index) {
                            return '<a href="#" onclick="detail(\'' + row.id + '\')">' + value + '</a>';
                        }

                    },
                    {
                        field: 'acqCode',
                        title: '通道编号',
                        align: 'center',
                    },
                    {
                        field: 'acqName',
                        title: '通道名称',
                        align: 'center',
                    },
                    {
                        field: 'acqUserId',
                        title: '上游用户id',
                        align: 'center',
                    },
                    {
                        field: 'acqOrderId',
                        title: '上游订单编号',
                        align: 'center',
                    },
                    {
                        field: 'orderId',
                        title: '订单编号',
                        align: 'center',
                    },

                    {
                        field: 'orderAmount',
                        title: '交易金额',
                        align: 'center',
                    },
                    {
                        field: 'payRate',
                        title: '交易费率',
                        align: 'center',
                    }
                    ,
                    {
                        field: 'payPro',
                        title: '交易笔数费',
                        align: 'center',
                    }
                    ,
                    {
                        field: 'orderStatus',
                        title: '订单状态',
                        align: 'center',

                    }
                    ,
                ]
            }
        ;
        $.table.init(options);
    });

    /*跳转计划明细页面*/
    function detail(id) {
        var url = prefix + '/detail/' + id;
        createMenuItem(url, "订单明细");
    }
</script>
</body>
</html>